\subsection{Integral remainder form of Taylor's theorem}
\begin{theorem}
	Let \(f\) such that \(f^{(n)}(x)\) is continuous for \(x \in [0, h]\).
	Then
	\[
		f(h) = f(0) + \dots + \frac{h^{n-1}f^{(n-1)}(0)}{(n-1)!} + R_n
	\]
	where
	\[
		R_n = \frac{h^n}{(n-1)!} \int_0^1 (1-t)^{n-1}f^{(n)}(th) \dd{t}
	\]
\end{theorem}
Note that for this formulation of Taylor's theorem, we require continuity of \(f^{(n)}(x)\), whereas with the previous remainders, the \(n\)th derivative need not be continuous.
\begin{proof}
	First, by substituting \(u = th\), we can see that it is sufficient to show
	\[
		R_n = \frac{1}{(n-1)!} \int_0^h (h - u)^{n-1}f^{(n)}(u) \dd{u}
	\]
	Now, integrating by parts, we have
	\begin{align*}
		R_n & = \frac{-h^{n-1}f^{(n-1)}(0)}{(n-1)!} + \frac{1}{(n-2)!}\int_0^h (h - u)^{n-2}f^{(n-1)}(u) \dd{u} \\
		    & = \frac{-h^{n-1}f^{(n-1)}(0)}{(n-1)!} + R_{n-1}
	\end{align*}
	Hence,
	\[
		R_n = -\frac{h^{n-1}f^{(n-1)}(0)}{(n-1)!} - \frac{h^{n-2}f^{(n-2)}(0)}{(n-2)!} - \dots - \underbrace{\int_0^h f'(u) \dd{u}}_{f(h) - f(0)}
	\]
	which is exactly all the other terms in the Taylor polynomial as required.
\end{proof}

\subsection{Mean value theorem for integrals}
\begin{theorem}
	Let \(f, g \colon [a, b] \to \mathbb R\) be continuous with \(g(x) \neq 0\) for all \(x \in (a, b)\).
	Then
	\[
		\exists c \in (a, b) \st \int_a^b f(x) g(x) \dd{x} = f(c)\int_a^b g(x)\dd{x}
	\]
\end{theorem}
Note that if we let \(g(x) = 1\), we get
\[
	\int_a^b f(x) \dd{x} = f(c)(b-a)
\]
\begin{proof}
	We will use Cauchy's mean value theorem to get this result.
	Let
	\[
		F(x) = \int_a^x fg;\quad G(x) = \int_a^x g
	\]
	Then there exists an intermediate point \(c\) such that
	\[
		(F(b) - F(a))G'(c) = F'(c)(G(b) - G(a))
	\]
	By the fundamental theorem of calculus,
	\[
		\qty(\int_a^b fg)g(c) = f(c)g(c)\qty(\int_a^b g)
	\]
	Now, since \(g \neq 0\) everywhere,
	\[
		\int_a^b fg = f(c)\int_a^b g
	\]
\end{proof}

\subsection{Deriving Lagrange's and Cauchy's remainders for Taylor's theorem}
We can use this new mean value theorem to recover the other forms of the remainders in Taylor's theorem.
We have
\[
	R_n = \frac{h^n}{(n-1)!} \int_0^1 (1-t)^{n-1}f^{(n)}(th) \dd{t}
\]
and we want to show that this is equal to
\[
	\frac{h^n}{n!}f^{(n)}(a + \theta h);\quad \frac{(1 - \theta)^{n-1}h^n f^{(n)}(a + \theta h)}{(n-1)!}
\]
First, let us apply the above mean value theorem with \(g \equiv 1\) and the entire integrand in \(R_n\) as \(f\).
Then
\[
	R_n = \frac{h^n}{(n-1)!} \int_0^1 (1-t)^{n-1}f^{(n)}(th) \dd{t} = \frac{h^n}{(n-1)!} (1-\theta)^{n-1}f^{(n)}(\theta h)
\]
as required for Cauchy's remainder.
To find Lagrange's remainder, we need to use the above mean value theorem with \(g = (1-t)^{n-1}\), which is positive everywhere in \((0, 1)\), and \(f = f^{(n)}(th)\).
Then
\[
	R_n = \frac{h^n}{(n-1)!} f^{(n)}(\theta h) \int_0^1 (1-t)^{n-1}\dd{t}
\]
This integral is simple to find by inspection:
\[
	R_n = \frac{h^n}{(n-1)!} f^{(n)}(\theta h) \frac{1}{n} = \frac{h^n}{n!} f^{(n)}(\theta h)
\]
as required.
